<?php

namespace Common\Service\ImbaLog;
use Think\Model\MongoModel;
// +----------------------------------------------------------------------
// | 文件 LogBaseService.class.php
// +----------------------------------------------------------------------
// | 说明 日志库
// +----------------------------------------------------------------------
// | 
// +----------------------------------------------------------------------
// | Author: 谢赤心 Legend. <xcx_legender@qq.com>
// +----------------------------------------------------------------------

Class LogBaseService extends MongoModel
{

    protected $connection;
    protected $pk           = 'id';
    protected $_idType      = self::TYPE_INT;
    protected $autoinc      =  true;         // $_autoinc 无效 
    protected $dbName       = 'imba_log';
    protected $tablePrefix  = 'imba_';  
    // protected $autoCheckFields = true;

    public function __construct($name='',$tablePrefix='',$connection='') {
        $this->connection = array(
            'db_type'       => 'mongo',
            'db_host'       => C('MONGODB_HOST', null, 'localhost'),#
            'db_port'       => C('MONGODB_PORT', null, 27017),
            'db_name'       => 'imba_log',
            'db_charset'    => 'utf8',
            'db_user'       => C('MONGODB_USERNAME', null, ''),
            'db_prefix'     => C('MONGODB_PREFIX', null, ''),
            'db_pwd'        => C('MONGODB_PASSWORD', null, ''),
        );
        parent::__construct($name,$tablePrefix, $this->connection);
    }

}